package ClientB;

import java.util.ArrayList;
import java.util.List;

public class Client {

    public static void main(String[] args) {

        System.out.println("----------------顾客B------------------");
        Shop shop = new Shop();

        Strawberry strawberry = shop.createFruit(Strawberry.class, "1");// 购买1斤草莓
        Mango mango = shop.createFruit(Mango.class, "3");// 购买3斤芒果
        Apple apple = shop.createFruit(Apple.class, "5");// 购买5斤苹果

        System.out.println(apple.showInfo());
        System.out.println(strawberry.showInfo());
        System.out.println(mango.showInfo());

        List<Fruit> fruits = new ArrayList<>();
        fruits.add(apple);
        fruits.add(strawberry);
        fruits.add(mango);
        System.out.println(shop.calculateTotalPrice(fruits));
    }

}
